<html><!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Demo - Constrain 使用示例</title>
    <script src="../../../../../../g.tbcdn.cn/kissy/k/1.3.2/seed.js" tppabs="http://g.tbcdn.cn/kissy/k/1.3.2/seed.js" data-config="{combine:true}"></script>
    <link rel="stylesheet" href="../../../../../../g.tbcdn.cn/kissy/k/1.3.2/css/dpl/base.css" tppabs="http://g.tbcdn.cn/kissy/k/1.3.2/css/dpl/base.css"/>

</head>
<body>

<div id="constrainContainer"
     style="width: 300px;height: 300px;border: 1px solid red;position: relative;">

    <div style="width: 100px;height: 100px;
    border: 1px solid green;
    position: absolute;left:10px;top:10px;"
         id="d">

    </div>

</div>
<button id="cd">contrain to div</button>
<button id="cw">constrain to window</button>
<button id="cn">no constrain</button>
<script src="assets/constrain.js" tppabs="http://docs.kissyui.com/1.3/source/raw/demo/dd/assets/constrain.js"></script>

</body>
</html>